package org.jdcenter.jndi.naming;

import java.util.Properties;

import javax.naming.Name;
import javax.naming.NameParser;
import javax.naming.NamingException;

public class JDSNameParser implements NameParser{
	
	Properties syntax = null;
	
	public JDSNameParser(){
		syntax = new Properties();
		syntax.setProperty("jndi.syntax.direction", "left_to_right");
		syntax.setProperty("jndi.syntax.separator","/");
	}
	
	public JDSNameParser(Properties syntax){
		this.syntax = syntax;
	}

	@Override
	public Name parse(String name) throws NamingException {
		return new JDSName(name,syntax);
	}

}
